package p4;

/**
 * @author krystal
 * @date 2022/11/10 9:21
 */
public class Demo4 {
    public static void main(String[] args) {
        System.out.println(sum(10));
    }

    public static int sum(int num){
        if(num == 1){
            return 1;
        }
        return num + sum(num-1);
    }
}
